const defaultMenu = (menuActionHandler: (key: string, options: any) => void) => {
    return  {
        'items': {
            'row_above': {'key': 'row_above'},
            'row_below': {'key': 'row_below'},
            '---------': {'key': '---------'},
            'col_left': {'key': 'col_left'},
            'col_right': {'key': 'col_right'},
            'remove_row': {'key': 'remove_row'},
            'remove_col': {'key': 'remove_col'},
            'undo': {'key': 'undo'},
            'redo': {'key': 'redo'},
            'make_read_only': {'key': 'make_read_only'},
            'alignment': {
                key: 'alignment',
                submenu: {
                    items: [
                        {
                            key: 'alignment:left',
                            name: '左对齐'
                        },
                        {
                            key: 'alignment:center',
                            name: '水平居中'
                        },
                        {
                            key: 'alignment:right',
                            name: '右对齐'
                        },
                        {
                            key: 'alignment:justify',
                            name: '两端对齐'
                        },
                        {
                            key: '---------',
                            name: '---------'
                        },
                        {
                            key: 'alignment:top',
                            name: '顶端对齐'
                        },
                        {
                            key: 'alignment:middle',
                            name: '垂直居中'
                        },
                        {
                            key: 'alignment:bottom',
                            name: '底端对齐'
                        },
                    ]
                }
            },
            'commentsAddEdit': {'key': 'commentsAddEdit'},
            'commentsRemove': {'key': 'commentsRemove'},
            'commentsReadOnly': {'key': 'commentsReadOnly'},
            'copy': {'key': 'copy'},
            'cut': {'key': 'cut'},
            'mergeCells': {'key': 'mergeCells'},
            'setCellAttribute': {
                'key': 'setCellAttribute',
                name: '设置单元格属性',
                callback: (key: string, options: any) => {
                    menuActionHandler('setCellAttribute', {
                        key,
                        options
                    });
                }
            },
        }
    }
}
export const hlContextMenu = (mode: 'editable' | 'write' | 'preview', menuActionHandler: (key: string, options: any) => void) => {
    if (mode !== 'editable') {
        return false;
    }
    return defaultMenu(menuActionHandler);
};
